﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vertica.Data.VerticaClient;
using System.Data;
using Hp.Vertica.Client.Internal;

namespace Hp.Vertica.Client
{
    public class Category
    {
        public Category() { }
        public Category(String name)
        {
            this.Name = name;
        }

        public Category(String name, VerticaDatabase db)
            : this(name)
        {
            this.Database = db;
        }
        public String Name { get; set; }

        public VerticaDatabase Database { get; set; }

        public List<Table> Objects
        {
            get
            {
                return this.Database.GetTables(this);
            }
        }

        public List<Schema> Schemas
        {
            get
            {
                return this.Database.GetSchemasByCategory(this);
            }
        }

        //public override bool Equals(object obj)
        //{
        //    return base.Equals(obj) || (obj.GetType() == this.GetType() && ((ObjectCategory)obj).Name == this.Name);
        //}

        //public override int GetHashCode()
        //{
        //    return this.Name.GetHashCode() * 17 + this.Database.GetHashCode();
        //}

        //public override string ToString()
        //{
        //    return this.Name;
        //}
    }
}
